You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > Mode Method > Statistics.Mode Method ([In] TVec)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.Mode Method ([In] TVec)

Mode of all Src vector elements.

Syntax
C#
Visual Basic
public static double Mode([In] TVec Src);

The mode of a data sample is the element that occurs most often in the collection. For example, the mode of the sample [1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17] is 6. Given the list of data [1, 1, 2, 4, 4] the mode is not unique, unlike the arithmetic mean.

Calculate the mode of sample data [1,5,2,11,5,3].

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector a = new Vector(0); a.SetIt(false, new double[] {1,5,2,11,5,3}); double md = Statistics.Mode(a); // md = 5 } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!